//
//  MSMetaDataTool.m
//  欢乐美食
//
//  Created by 遇水 on 15/6/8.
//  Copyright (c) 2015年 遇水. All rights reserved.
//  此类主要处理项目中的元数据

#import "MSMetaDataTool.h"
#import "MSCities.h"
#import "MSFoots.h"
#import "MSCityGroup.h"
@interface MSMetaDataTool ()
{
    NSArray *_foots;
    NSArray *_cities;
    NSArray *_cityGroups;
}

@end
@implementation MSMetaDataTool
HMSingletonM(MetaDataTool);
/**
 *  获得各种数据的懒加载
 */

-(NSArray *)foots{
    if (!_foots) {
        _foots = [MSFoots objectArrayWithFilename:@"foot.plist"];
        //实现具体的加载实现
    }
    return _foots;
}





-(NSArray *)cities{
    if (!_cities) {
        _cities = [MSCities objectArrayWithFilename:@"cities.plist"];
        //实现具体的加载实现
    }
    return _cities;
}


-(NSArray *)cityGroups{
    if (!_cityGroups) {
        _cityGroups = [MSCityGroup objectArrayWithFilename:@"cityGroups.plist"];
        //实现具体的加载实现
    }
    return _cityGroups;
}

- (MSCities *)cityWithName:(NSString *)name
{
    if (name.length == 0) return nil;
    
    for (MSCities *city in self.cities) {
        if ([city.name isEqualToString:name]) return city;
    }
    return nil;
}


@end
